<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<%@include file="/common/head.jsp" %>

<c:set var="module" value="cart"/>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
		<form action="${ctx }/admin/cart/save?id=${n.id }" id="detail-form" class="form-horizontal" method="post">
			<div class="form-group">
                 <label class="col-sm-2 control-label">用户</label>
                 <div class="col-sm-10">
                 	<%-- <input type="text" class="form-control" name="user.id" value="${n.user.id }"> --%>
                 	<input type="hidden"  id="user-id" name="user.id" value="${n.user.id }" class="form-control">
                 	<input type="text" placeholder="用户" class="form-control" id="username" name="user.name" value="${n.user.username }" 
                 		onclick="bring({
						                 	url:'${ctx}/admin/user/list',
						                 	name: 'username',
						                 	idInput: 'user-id',
						                 	nameInput: 'username'
						                 	})" />
                 </div>
             </div>	
			<div class="form-group">
                 <label class="col-sm-2 control-label">商品</label>
                 <div class="col-sm-10">
                 	<%-- <input type="text" class="form-control" name="product.id" value="${n.product.id }"> --%>
                 	<input type="hidden" id="product-id" name="product.id" value="${n.product.id }" class="form-control">
                 	<input type="text"  placeholder="商品" class="form-control" id="product-name" name="product.name" value="${n.product.name }" 
                 		onclick="bring({
						                 	url:'${ctx}/admin/product/list',
						                 	name: 'name',
						                 	idInput: 'product-id',
						                 	nameInput: 'product-name'
						                 	})" />
                 </div>
             </div>	
			<div class="form-group">
                 <label class="col-sm-2 control-label">商品规格</label>
                 <div class="col-sm-10">
                 	<%-- <input type="text" class="form-control" name="specification.id" value="${n.specification.id }"> --%>
                 	<input type="hidden" id="specification-id" name="specification.id" value="${n.specification.id }" class="form-control">
                 	<input type="text"  placeholder="商品规格" class="form-control" id="specification-name" name="specification.name" value="${n.specification.spec1 }" 
                 		onclick="bring({
						                 	url:'${ctx}/admin/specification/list',
						                 	name: 'spec1',
						                 	idInput: 'specification-id',
						                 	nameInput: 'specification-name'
						                 	})" />
                 </div>
             </div>	
			<div class="form-group">
                 <label class="col-sm-2 control-label">数量</label>
                 <div class="col-sm-10">
                 	<input type="text" class="form-control" name="quantity" value="${n.quantity }">
                 </div>
             </div>	
        	
		</form>
</div>

<%@include file="/common/foot.jsp" %>

</body>
</html>
